//
//  WHStatus.swift
//  8.31-WH微博
//
//  Created by 吴涵 on 15/9/10.
//  Copyright © 2015年 wuhan. All rights reserved.
//

import UIKit

class WHStatus: NSObject {
 /// 创建时间
    var created_at: String?
/// 微博ID
    var id : Int = 0
/// 微博内容
    var text : String?
/// 微博来源
    var source: String?
    /// 被转发的原创微博对象
    var retweeted_status: WHStatus?
    /// 保存URL字符串的数组
    var pic_urls: [[String: String]]?
    /// 用户
    var user: WHUser?
     init(dict: [String: AnyObject]) {
        super.init()
        
        setValuesForKeysWithDictionary(dict)
    }
    override func setValue(value: AnyObject?, forUndefinedKey key: String) {
    }
    override func setValue(value: AnyObject?, forKey key: String) {
        if  key == "user" {
            user = WHUser(dict: value as! [String : AnyObject])
            return
        }
        if key == "retweeted_status" {
            retweeted_status = WHStatus(dict: value as! [String: AnyObject])
            return
        }
        super.setValue(value, forKey: key)
    }
    override var description: String {
        let keys = ["created_at","id","text","source","user","pic_urls","retweeted_status"]
        
        return dictionaryWithValuesForKeys(keys).description
    
    }

}
